package org.whh.metadata.datasource.database;

import lombok.Data;
import org.whh.metadata.datasource.AbstractDataSource;

import java.sql.Connection;
import java.util.Properties;

/**
 * @Version v1.0
 * @Author Ryan
 * @Date 2021/7/10
 * N-G-P
 */
@Data
public abstract class DBDatasource extends AbstractDataSource {

    private String diverName;
    private String serverName ;
    private String databaseName;
    private String user;
    private String url;
    private String password;
    private int portNumber;
    private Properties properties = new Properties();


    /**
     * build the url,if url is not set
     * @return the build url
     */
    public abstract String buildUrl();

    /**
     * get connection
     * @return return the Specific database connection
     */
    public abstract Connection getConnection();

}
